package com.ming.study.service;

import com.ming.study.pojo.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ming.study.pojo.UserInfo;
import com.ming.study.pojo.vo.UserLoginVo;

import java.util.Date;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author mingyue
 * @since 2020-12-15
 */
public interface UserService extends IService<User> {

    /**
     * 登录
     * @param userLoginVo
     * @return
     */
    String loginOrRegister(UserLoginVo userLoginVo);

    /**
     * 获取用户信息
     * @return
     */
    UserInfo getUserInfo();

    /**
     * 判断用户是否在登录有效期内
     * @param createTime
     * @return
     *//*
    static boolean isUserVaild(long createTime) {
        long serviceTime = new Date().getTime() - createTime;
        // 登陆时长不超过5小时
        return (serviceTime / (60 * 60 * 1000) < 5);
    }*/
}
